package practice;

import abstract1.Shape;
import abstract1.Rectangle;

import java.awt.*;

public interface Plane2D {
    int getArea();
}

class Rectangle2 extends Rectangle implements Plane2D{
    public Rectangle2(int width, int height) {
        super(width,height);
    }

    public int getArea(){return super.getWidth()*super.getHeight();}
}



class parallelogram extends Shape implements Plane2D{
private int width;
private int height;
    @Override
    public String toString() {
        return "parallelogram:width:"+width+"height:"+height;
    }

    @Override
    public void draw() {
        for (int i = 0; i <height ; i++) {
            for (int j = 0; j <height-i ; j++) {
                System.out.print(" ");
            }
            for (int k = 0; k <width ; k++) {
                System.out.print("*");
            }
        }
    }

    @Override
    public int getArea() {
        return width*height;
    }
}
